package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;

@TableName("t_user")
public class UserBean {
    @TableId(value = "pk_userid",type = IdType.AUTO)
    private Integer id;

    @TableField("u_name")
    private String name;

    @TableField("u_pwd")
    private String pwd;

    @TableField("u_email")
    private String email;

    @TableField("u_img")
    private String img;
    /** 默认为当前时间 */
    @TableField("u_date")
    private LocalDate date = LocalDate.now();

    public UserBean() {
    }

    public UserBean(String name, String pwd, String email, String img) {
        this.name = name;
        this.pwd = pwd;
        this.email = email;
        this.img = img;
    }


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    @Override
    public String toString() {
        return "UserBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", pwd='" + pwd + '\'' +
                ", email='" + email + '\'' +
                ", img='" + img + '\'' +
                ", date=" + date +
                '}';
    }
}
